package com.chinawayltd.ews.sample.service.base.impl;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.chinawayltd.ews.sample.core.consts.SystemConsts;
import com.chinawayltd.ews.sample.model.openApi.UserDTO;

public class BaseServiceImpl{

	public UserDTO getCurrentUser(){
		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();  
		UserDTO user = (UserDTO) request.getAttribute(SystemConsts.SESSION_USER);
//		UserDTO user = new UserDTO();
//		user.setRealname("本地测试");
		return user;
	}
}
